home *** CD-ROM | disk | FTP | other *** search
Text File | 1986-11-22 | 84.6 KB | 2,374 lines |
-
-
-
-
-
-
-
-
-
-
-
-
-
- TURBO ENHANCEMENT TOOLKIT DOCUMENTATION
-
- User-Supported Software
-
-
- Programmer's Utilities
-
- by
-
- Kevin Dahl
-
- 1711 4th St N
- Wahpeton, North Dakota 58075
-
-
- Version 2.00 - December 1986
-
- (C) Copyright 1986 by Kevin W. Dahl
- ..page
- ..foot48Ri
- INTRODUCTION
-
- This product is hereby released to the public domain
- for personal, non-commercial use only. Any feedback
- will be appreciated.
-
- NOTICE:
-
- A limited license is granted to all users of these
- routines, to make copies of these routines and
- distribute them to other users, on the following
- conditions:
- 1. The routines are not to be distributed to others
- in modified form.
- 2. No fee is to be charged for copying or
- distributing these routines without an express -
- written agreement with the author, Kevin W. Dahl,
- Copyright (C) 1986
-
- The number of global type and variable declarations
- have been kept to a minimum, so most of these routines
- do not require any global declarations. You will find
- the routines included here work primarily with the
- video display screen.
-
- While these procedures and functions work only with the
- video display I hope to add more procedures and
- functions to this library that work with other areas of
- the PC. Your comments and suggestions on how to
- improve and extend the usefulness of this library will
- be appreciated.
-
- I hope these routines make your programming efforts
- easier and more enjoyable.
- Kevin
-
-
-
-
-
- Turbo Pascal is a trademark of Borland International
- ..page
- ..foot48Rii
- =============== User-Supported Software ===============
-
-
- If you have received these routines from another user
- and find them to be of value, your contribution
- will be greatly appreciated.
-
- ( $10.00 suggested ).
-
-
- ------------------------------
-
- Kevin W. Dahl
- 1711 4th St N
- Wahpeton, ND 58075
-
- ------------------------------
-
- Regardless of whether you make a contribution, you are
- encouraged to copy and distribute these routines.
-
- =======================================================
-
- The user-supported concept:
-
- Anyone may request a copy of a user-supported program
- by sending a blank, formatted disk to the author of the
- program. An addressed, postage-paid return mailer must
- accompany the disk (no exceptions, please).
-
- A copy of the program, with documentation, will be sent
- by return mail. The program will carry a notice
- suggesting a contribution to the program's author.
- Making a contribution is completely voluntary on the
- part of the user.
-
- Regardless of whether a contribution is made, the user
- is encouraged to copy and share the program with
- others. Payment for use is discretionary on the part
- of each subsequent user.
- ..page
- ..foot48Riii
- FUTURE ENHANCEMENTS AND UPDATE POLICY:
-
- These routines are being distributed under the user-
- supported concept and will only be improved if you make
- suggestions for improvements and enhancements you would
- like to see.
-
- Provided users support these routines, the following
- will apply. Any time there are revisions or updates to
- the routines all Registered Owners will be notified.
-
- Help all public domain contributors by sending your
- contribution for the programs and routines you find
- useful.
-
- If users find these routines of use and send their
- contributions to me, I will add more procedures and
- functions to this library.
-
- *** NOTE ***
-
- The current source code for all of these routines has
- been written using the Microsoft Macro Assembler
- Version 4.0. Some of the routines can be assembled,
- because of the assembler directives available, and used
- with Microsoft Pascal. If you are a registered user
- you may obtain a copy of the source code by sending a
- check for $35.00, unregistered $50.00, to:
-
- Kevin Dahl
- 1711 4th St N
- Wahpeton, ND 58075
- (701) 642-2445
- ..page
- ..foot48Riv
- Table of Contents
-
- CHAPTER 1
- System Requirements ...................... 1-1
- File Requirements ........................ 1-1
-
- CHAPTER 2 - VIDEO PROCEDURES AND FUNCTIONS
-
- BoarderColor ............................. 2-1
- ClrWin ................................... 2-2
- ColorMsg ................................. 2-3
- EditSt ................................... 2-4
- FillCol .................................. 2-9
- FillColAttr .............................. 2-10
- FillRow .................................. 2-11
- FillRowAttr .............................. 2-12
- FrameWin ................................. 2-13
- GetCursorSize ............................ 2-15
- GetScrn .................................. 2-16
- GetVideoMode ............................. 2-18
- GotoXYAbs ................................ 2-19
- InitVideo ................................ 2-20
- PutScrn .................................. 2-21
- RvsVideo ................................. 2-23
- ScrollDn ................................. 2-24
- ScrollLeft ............................... 2-26
- ScrollUp ................................. 2-28
- ScrollRight .............................. 2-30
- SetCursorSize ............................ 2-32
- WaitMsg .................................. 2-33
- WhereXAbs ................................ 2-35
- WhereYAbs ................................ 2-36
- WriteSt .................................. 2-37
- WriteStLn ................................ 2-38
-
- CHAPTER 3 - KEYBOARD PROCEDURES AND FUNCTIONS
-
- ClrKbd ................................... 3-1
- GetKbdElmt ............................... 3-2
- KbdStatus ................................ 3-3
- ReadKbd .................................. 3-4
- ..page
- ..foot48Rv
- APPENDIX A
- Summary of Procedures and Functions ...... A-1
-
- APPENDIX B
- Keyboard codes ........................... B-1
-
- APPENDIX C
- Keyboard element codes ................... C-1
-
- APPENDIX D
- Keyboard return codes .................... D-1
-
- APPENDIX E
- Keyboard scan codes ...................... E-1
- ..page
- ..pgno01
- ..foot48R1-##
- SYSTEM REQUIREMENT:
-
- IBM-PC or true compatible
- 64k RAM
- 1 disk drive
- DOS 2.0 or greater
- Turbo Pascal 3.0 or greater
-
- FILE REQUIREMENTS
-
- Since these external routines are written in
- assembly language the assembled modules are
- included on the disk.
-
- Only the routines you use in your programs must be
- on the disk during compliation of your program. To
- determine which external routine must be on your
- disk refer to the Filename listed in the
- documentation on the procedure you are using. For
- example, if you were using the procedure RvsVideo,
- then the file V15.ENH must be on your disk and you
- would also need the procedure declaration:
-
- Procedure RvsVideo; External 'V15.ENH'
-
- at the beginning of your source code in your
- program.
- ..page
- NOTATION ON VIDEO COORDINATES
-
- I decided to include this section on video coordinates
- because of the consistencies or inconsistencies of the
- notation used in describing the (x,y) or (row,col)
- coordinates of the video screen. The basic programming
- manuals I have looked through describe the screen text
- coordinates as (row,col) coordinates where row is a
- value from 1 to 25 and col is a value from 1 to 40 or
- 80 depending on the screen width. Notice the row is
- presented first. If you have noticed, most word
- processors also use this in the form of (line,column)
- notation. In the pascal books that I have read the
- text coordinates are described as (x,y) coordinates
- where x is a value from 1 to 40 or 80 and y is a value
- from 1 to 25. Notice here the column number of the
- (row,col) notation is presented first. They are the
- reverse of each other.
-
- Since these routines are written mainly for use with
- Turbo Pascal and the screen coordinates are described
- as (x,y) coordinates I have decided to use the (x,y)
- coordinate notation. References are also made to rows
- and columns. In these cases row has the meaning of a
- value from 1 to 25 and column has a value from 1 to 80.
- In order to use the (x,y) and (row,column) notation
- interchangeably the following is true:
-
- (x,y) = (col,row)
-
- since x and col both refer to the values 1 to 40 or 80
- depending on screen width, and y and row both refer to
- the values 1 to 25.
-
- If it's confusing just think about the regular
- mathematical notation used in describing the (x,y)
- coordinates on an (x,y) graph in the fourth quadrant
- where y is always evaluated as a positive value instead
- of a negative value.
- ..page
- ..pgno01
- ..head03RBOARDERCOLOR
- ..head04RProcedure
- ..head05L_______________________________________________________
- ..foot48R2-##
- Purpose : Sets the color for the boarder screen.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V1.ENH
-
- Format : BoarderColor(Color);
-
- Remarks : Color is an integer in the range 0
- to 15. It is the color for
- the border screen.
-
- The following colors are allowed for the
- boarder color if you have a Color/Graphics
- Monitor Adapter.
-
- 0 Black 8 Gray
- 1 Blue 9 Light Blue
- 2 Green 10 Light Green
- 3 Cyan 11 Light Cyan
- 4 Red 12 Light Red
- 5 Magenta 13 Light Magenta
- 6 Brown 14 Yellow
- 7 White 15 High-intensity White
-
-
- Example : BoarderColor(1);
-
- BoarderColor will display a blue boarder on
- a color monitor.
-
- Note : BoarderColor does not have any effect on
- a monochrome monitor.
-
- ..page
- ..head03RCLRWIN
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Clears the current window area.
-
- Versions : 2.00 3.00 3.01B
- ** **
-
- Filename : V2.ENH
-
- Format : ClrWin;
-
- Remarks : This procedure will blank the window area
- that is currently defined by Turbo Pascal.
- ClrWin will use the text color and the text
- background color that is currently defined
- by Turbo Pascal as the color to use for the
- window area. ClrWin does not affect the
- position of the cursor.
-
- Example : Window(5,5,40,20);
- TextColor(Black);
- TextBackGround(Blue);
- ClrWin;
-
- After the window size is define and the
- foreground and background colors are set
- ClrWin will clear the defines window and a
- blue background color will be displayed on
- a color monitor.
- ..page
- ..head03RCOLORMSG
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Display a message to the screen using the
- color attribute specified.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V3.ENH
-
- Format : ColorMsg(X,Y,Attr,Message)
-
- Remarks : X is an integer in the range 1
- to 40 or 1 to 80, depending
- upon the screen width. It
- gives the absolute column
- on the screen.
-
- Y is an integer in the range 1
- to 25. It gives the absolute
- row on the screen.
-
- Attr is an integer in the range 0
- to 255. It gives the
- attribute color to be used for
- displaying the message.
-
- Message is any string expression.
-
- ColorMsg is NOT sensitive to Turbo's
- currently defined window and will wrap
- around to column one on the next line of
- the screen when necessary.
-
- ColorMsg will not scroll the screen if the
- data to be displayed is to extend beyond
- the last row of the screen.
-
- Special Note : ColorMsg requires the following global
- type definition:
-
- Str255 = String[255];
- ..page
- ..head03REDITST
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Edit an existing or null string from the
- keyboard.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V26.ENH
-
- Format : EditSt(Y,StartX,StopX,Len,CM,
- VCSet,TCSet,TE,St );
-
- Remarks : Y is an integer in the range 1
- to 25. It gives the absolute
- row on the screen for the
- string to be editted on.
-
- StartX is the first column on the row
- that is used for the edit
- string.
-
- StopX is the last column on the row
- that can be used for the edit
- string.
-
- Len is an integer in the range 1
- to 255. It gives the maximum
- length of the string to be
- editted from the keyboard.
-
- CM is an integer in the range of
- 1 to 3. The Case Mode
- indicator determines how a
- character is displayed on the
- screen.
- 1 = Both case.
- 2 = Upper case only
- 3 = Lower case only
-
- VCSet is the set of valid characters
- that will be accepted for data
- entry.
- ..page
- ..head05L
- TCSet is the set of extended
- keyboard characters that are
- allowed to terminate this
- procedure.
- (Refer to appendix C.)
-
- TE is the terminating element
- number that terminated the
- string input procedure. TE
- will be in the range of 0-255
- which corresponds to the
- element number in appendix C.
-
- St is the string or character
- array to receive data from the
- keyboard. Upon return the
- first byte contains the length
- of the string.
-
- The maximum length of the edit string is
- 255 characters. The data that is entered
- will be entered on one line. If the maximum
- length of the string exceeds the length
- StopX - StartX + 1 the string will scroll
- horizontally on the screen within the
- StartX and StopX columns.
-
- Example : Var
- St : String[255];
- TE : Integer;
- VCSet,TCSet : Set of 0..255;
-
- VCSet := [32..126];
- TCSet := [1,13,72,80];
- Input(5,10,20,30,2,VCSet,TCSet,TE,St);
-
- This example will edit a string of up to
- thirty characters into St. The screen will
- display the entering of each character
- starting in column 10 on row 5. The
- display area of the screen goes from
- columns ten to twenty and will do a
- horizontal scroll in that area when the
- eleventh character is entered.
-
- All aphabetic characters, ['A'..'Z',
- 'a'..'z'], that are pressed will be
- displayed in upper case.
-
- The keys that will terminate this procedure
- are the Esc, Enter, Up and Down Arrow keys.
- TE will return the proper terminating
- element number as given in appendix C.
-
-
- Editing : The following gives a brief explanation of
- the editing keys that may be used with
- EditSt, provided the keypressed is not
- defined in the terminating character set.
-
- LeftArr will move the cursor left one
- character position on the
- screen until the StartX column
- is reached. If the beginning
- of the string has not been
- reached the string will be
- scrolled on the screen within
- the startx and stopx column
- boundaries.
-
- RightArr will move the cursor right one
- character position on the
- screen until the end of the
- string is reached. If the
- cursor is in the stop column
- and there is still more in the
- string that can be displayed
- the string will then be
- scrolled within the StartX and
- StopX boundaries.
- ..page
- Home will place the cursor in the
- StartX column on the screen
- and positioned under the first
- character in the edit string.
-
- End will place the cursor in the
- StopX column on the screen and
- positioned after the last
- character in the edit string.
-
- BackSpace If the StartX column is
- displaying the first character
- in the string being editted
- the cursor will move to the
- left one column and delete the
- character in that column.
-
- If the character being
- displayed in the StartX column
- is not the first character in
- the string being editted the
- cursor will remain in the same
- column position and delete the
- character to the left of the
- cursor and pull the string
- towards the cursor.
-
- Esc will blank the string
- currently in the field. If
- the field is already blank the
- procedure will return the
- string that was passed to this
- procedure.
-
- Tab or will move the cursor to the
- Ctrl right five column positions if
- RightArr the StopX column has not been
- reached. If the StopX column
- has been reached then only the
- string display will be
- adjusted.
- ..page
- Ctrl will move the cursor to the
- LeftArr left five column positions if
- or the StartX column has not been
- Shft-Tab reached. If the cursor is in
- the StartX column then only
- the display string will be
- adjusted to reflect the
- movement of the cursor.
-
- Del removes the character the
- cursor is under and decrements
- the string length by one. All
- the characters to the right of
- the cursor position are
- shifted left one character
- position within the string and
- the display area.
- ..page
- ..head03RFILLCOL
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Fill a column on the screen with a
- character.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V4.ENH
-
- Format : FillCol(X,Y,Num,Ch);
-
- Remarks : X is an integer in the range 1
- to 40 or 1 to 80, depending
- upon the screen width. It
- gives the absolute column
- on the screen.
-
- Y is an integer in the range 1
- to 25. It gives the absolute
- row on the screen.
-
- Num is an integer in the range 1
- to 25 for the number of rows
- to display the character in.
-
- Ch is the character to be
- displayed Num times in the
- column on the screen.
-
- FillCol always acts on the entire screen
- and is NOT sensitive to Turbo's currently
- defined window.
-
-
- Example : FillCol(1,1,20,'-');
-
- Starting in row one column one twenty
- minus sign characters will be displayed in
- column one.
- ..page
- ..head03RFILLCOLATTR
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Display a column of attribute bytes to the
- display screen.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V5.ENH
-
- Format : FillColAttr(X,Y,Num,Attr);
-
- Remarks : X is an integer in the range 1
- to 40 or 1 to 80, depending
- upon the screen width. It
- gives the absolute column
- on the screen.
-
- Y is an integer in the range 1
- to 25. It gives the absolute
- row on the screen.
-
- Num is an integer in the range 1
- to 25 for the number of rows
- to display the attribute byte
- on.
-
- Attr is the attr to be displayed
- Num times in the column on the
- screen.
-
- FillColAttr always acts on the entire
- screen and is NOT sensitive to Turbo's
- currently defined window.
-
-
- Example : FillColAttr(1,1,20,48);
-
- In this example the attribute color 48 will
- be displayed 20 times in column 1 starting
- on row one of the screen.
- ..page
- ..head03RFILLROW
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Write one or more copies of a single
- character to the screen starting at the X,Y
- coordinates passed.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V6.ENH
-
- Format : FillRow(X,Y,Num,Ch);
-
- Remarks : X is an integer in the range 1
- to 40 or 1 to 80, depending
- upon the screen width. It
- gives the absolute column
- on the screen.
-
- Y is an integer in the range 1
- to 25. It gives the absolute
- row on the screen.
-
- Num is the number of times to
- display the character to the
- screen.
-
- Ch is the character to be
- displayed Num times on the
- screen.
-
- FillRow always acts on the entire screen
- and is NOT sensitive to Turbo's currently
- defined window.
-
- Example : FillRow(1,1,80,'-');
-
- In this example 80 minus sign characters
- will be displayed starting on row one,
- column one of the screen.
- ..page
- ..head03RFILLROWATTR
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Write one or more copies of the attribute
- byte to the screen starting at the X,Y
- coordinates passed.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V7.ENH
-
- Format : FillRowAttr(X,Y,Num,Attr);
-
- Remarks : X is an integer in the range 1
- to 40 or 1 to 80, depending
- upon the screen width. It
- gives the absolute column
- on the screen.
-
- Y is an integer in the range 1
- to 25. It gives the absolute
- row on the screen.
-
- Num is the number of times to
- display the attribute byte to
- the screen.
-
- Attr is the attribute byte to be
- displayed Num times on the
- screen.
-
- FillRowAttr always acts on the entire
- screen and is NOT sensitive to Turbo's
- currently defined window.
-
-
- Example : FillRowAttr(1,1,80,48);
-
- In this example, starting at row one,
- column one of the screen the color
- attribute byte 48 will be used.
- ..page
- ..head03RFRAMEWIN
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Frames the window currently defined by
- Turbo with the characters passed.
-
- Versions : 2.00 3.00 3.01B
- ** **
-
- Filename : V8.ENH
-
- Format : FrameWin(UL,UR,LL,LR,Hor,Ver);
-
- Remarks : UL is the character in the upper
- left corner of the window.
-
- UR is the character in the upper
- right corner of the window.
-
- LL is the character in the lower
- left corner of the window.
-
- LR is the character in the lower
- right corner of the window.
-
- Hor is the horizontal character
- for the top and bottom lines
- of the window.
-
- Ver is the vertical character for
- the left and right vertical
- lines of the window.
-
- FrameWin will outline the window that is
- currently defined by Turbo with the
- characters passed.
-
- Once the window frame has been displayed
- the active window will be adjusted to fit
- within the framed area.
- ..PAGE
- ..head05L
- For example if the current window is
- defined as 1,1,80,25 then after FrameWin
- the current window will be 2,2,79,24.
-
- Example : FrameWin('-','-','-','-','-','|');
-
- The above statement will use minus signs
- for the top and bottom lines and the single
- bar for the two sides.
-
-
- FrameWin('L','R','l','r','H','V');
-
- The frame this statement will draw is shown
- below:
-
-
- LHHHHHHHHHHHHHHHHHHHHHHHHHHR
- V V
- V V
- V V
- V V
- V V
- V V
- V V
- lHHHHHHHHHHHHHHHHHHHHHHHHHHr
- ..page
- ..head03RGETCURSORSIZE
- ..head04RFunction
- ..head05L_______________________________________________________
- Purpose : Return the starting and ending scan lines
- for the current cursor.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V9.ENH
-
- Format : GetCursorSize;
-
- Remarks : Returns an integer with:
-
- High byte -- starting scan line
- Low byte -- ending scan line
-
- Example : Write(Hi(GetCursorSize),Lo(GetCursorSize));
-
- This example will print on one line the
- current starting scan line and ending scan
- line respectively.
-
- i := GetCursorSize;
-
- In this example i will receive the starting
- and ending scan line of the cursor. The
- high byte will be the starting scan line of
- the cursor and the low byte will be the
- ending scan line of the cursor.
- ..page
- ..head03RGETSCRN
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Read the character and attribute bytes from
- the screen into a character array.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V10.ENH
-
- Format : GetScrn(X,Y,NumWords,ChArray);
-
- Remarks : X is an integer in the range 1
- to 40 or 1 to 80, depending
- upon the screen width. It
- gives the absolute column
- on the screen.
-
- Y is an integer in the range 1
- to 25. It gives the absolute
- row on the screen.
-
- NumWords is an integer in the range 1
- to 1000 or 1 to 2000,
- depending upon the screen
- width. It gives the number of
- words to get from the display
- screen. Its value is the total
- number of bytes to get divided
- by 2.
-
- ChArray is any character or string
- array that will receive the
- character and attribute bytes
- from the screen. The minimum
- size of ChArray is NumWords*2.
-
- This procedure works much like Turbo's move
- statement but in addition checks for the
- vertical retrace of the video adapter to
- eliminate the snow effect that the move
- statement would produce on a Color/Graphics
- Adapter.
-
- ..head05L
- GetScrn is the inverse of the PutScrn
- procedure.
-
-
- Example : GetScrn(1,1,80,ChArray[1]);
-
- In this example the size of ChArray is at
- least 160 bytes long. A copy of row one on
- the screen will be placed in ChArray.
- ChArray will contain both the attribute and
- character bytes from the screen.
-
- In the next example the size of ChArray
- must be at least 320 bytes in size, and the
- first two rows of the screen will be placed
- into ChArray.
-
- GetScrn(1,1,160,ChArray);
-
- Notice that in the first example the
- address of ChArray[1] was passed as the
- parameter and in the second example ChArray
- was not subscripted. Both examples will
- work because the ChArray parameter is
- defined as an untyped variable.
- ..page
- ..head03RGETVIDEOMODE
- ..head04RFunction
- ..head05L_______________________________________________________
- Purpose : Returns the current video mode.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
- Filename : V11.ENH
-
- Format : GetVideoMode;
-
- Remarks : Returns an integer giving the current video
- mode the system is in. Use the guide on
- video modes under INITVIDEO.
-
- Example : Writeln(GetVideoMode);
-
- This example will print the current video
- mode the system is in.
- ..page
- ..head03RGOTOXYABS
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Position the cursor at the absolute x,y
- coordinates on the screen.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V12.ENH
-
- Format : GotoxyAbs(X,Y);
-
- Remarks : X is an integer in the range 1
- to 40 or 1 to 80, depending
- upon the screen width. It
- gives the absolute column
- on the screen.
-
- Y is an integer in the range 1
- to 25. It gives the absolute
- row on the screen.
-
- This procedure will place the cursor at the
- x,y coordinates of the physical screen.
- GotoxyAbs is NOT sensitive to the window
- that is currently defined by turbo.
- ..page
- ..head03RINITVIDEO
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Initialize the video mode.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V13.ENH
-
- Format : InitVideo(Mode);
-
- Remarks : To set the screen to the appropriate video
- mode use the following table as a guide.
-
-
- -----------------------------------------------------
- | Mode | Type | Colors | Adaptera |
- -----------------------------------------------------
- | 0 | Text - 40 x 25 B/W | b/w | CGA |
- | 1 | Text - 40 x 25 COLOR | 16 | CGA |
- | 2 | Text - 80 x 25 B/W | b/w | CGA |
- | 3 | Text - 80 x 25 COLOR | 16 | CGA |
- | 4 | Graphics - 320 x 200 | 4 | CGA |
- | 5 | Graphics - 320 x 200 | 4 grey | CGA |
- | 6 | Graphics - 640 x 200 | b/w | CGA |
- | 7 | Text - 80 x 25 | 16 | MA |
- | 8 | Graphics - 160 x 200 | 16 | PCjr |
- | 9 | Graphics - 320 x 200 | 4,64 | PCjr |
- | 10 | Graphics - 640 x 200 | 16 | PCjr,EGA |
- | 13 | Graphics - 320 x 200 | 16 | EGA |
- | 14 | Graphics - 640 x 200 | 16 | EGA |
- | 15 | Graphics - 640 x 350 | 4 | EGA |
- ----------------------------------------------------
-
- Example : InitVideo(3);
-
- This example will initialize the video mode
- to 80 x 25 color text.
- ..page
- ..head03RPUTSCRN
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Display character and attribute on the
- screen.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V14.ENH
-
- Format : PutScrn(X,Y,NumWords,ChArray);
-
- Remarks : X is an integer in the range 1
- to 40 or 1 to 80, depending
- upon the screen width. It
- gives the absolute column
- on the screen.
-
- Y is an integer in the range 1
- to 25. It gives the absolute
- row on the screen.
-
- NumWords is the number of words to
- display.
-
- ChArray is the character array that
- contains the bytes to display
- on the screen. The minimum
- size of ChArray is NumChars*2.
-
- This procedure works much like Turbo's move
- statement but in addition checks for the
- vertical retrace of the video adapter to
- eliminate the snow effect that the move
- statement would produce on a Color/Graphics
- Adapter.
-
- PutScrn is the inverse of the GetScrn
- procedure.
- ..page
- ..head05L
- Example : PutScrn(1,1,80,ChArray[1]);
-
- In this example the size of ChArray is at
- least 160 bytes long. The first 160 bytes
- of ChArray will be placed on the screen
- starting at row one column one of the
- screen. Both the attribute and character
- bytes will be written to the screen.
-
- In the next example the size of ChArray
- must be at least 320 bytes in size, and
- will write 320 bytes to the first two rows
- of the screen.
-
- PutScrn(1,1,160,ChArray);
-
- Notice that in the first example the
- address of ChArray[1] was passed as the
- parameter and in the second example
- ChArray was not subscripted. Both
- examples will work because the ChArray
- parameter is defined as an untyped
- variable.
- ..page
- ..head03RRVSVIDEO
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Reverses current video attribute bytes.
-
- Versions : 2.00 3.00 3.01B
- ** **
-
- Filename : V15.ENH
-
- Format : RvsVideo;
-
-
- Remarks : RvsVideo exchanges the three foreground and
- three background attribute bits that are
- currently defined by Turbo Pascal's
- attribute byte.
-
- Example : Foreground color --> white.
- Background color --> black.
-
- If the above is true for the foreground and
- background colors then after calling
- RvsVideo the foreground and background
- colors will be as follows:
-
- Foreground color --> black.
- background color --> white.
- ..page
- ..head03RSCROLLDOWN
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Scroll the window down N lines filling in
- blank lines at the top of the window with
- the attribute passed.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V16.ENH
-
- Format : ScrollDown(Lines,Attr,X1,Y1,X2,Y2);
-
- Remarks : Lines is an integer in the range 0
- to 25. If gives the number of
- lines the window is to be
- scrolled.
-
- Attr is an integer in the range 0
- to 255. It gives the
- attribute to be used when
- filling in the blank lines at
- the top of the window.
-
- X1 is an integer in the range 1
- to 40 or 1 to 80, depending
- upon the screen width. It
- gives the left column of the
- window on the screen.
-
- Y1 is an integer in the range 1
- to 25. It gives the top row
- of the window on the screen.
-
- X2 is an integer in the range 1
- to 40 or 1 to 80, depending
- upon the screen width. It
- gives the right column of the
- window on the screen.
- ..page
- ..head05L
- Y2 is an integer in the range 1
- to 25. It gives the bottom
- row of the window on the
- screen.
-
- Example : ScrollDown(1,48,4,5,15,20);
-
- In this example one line will be scrolled
- down in the window with the top row (row 5)
- being filled in with cyan on a
- Color/Graphics Adapter.
-
- ScrollDown(0,7,4,5,15,20);
-
- In this example the entire window will be
- cleared.
- ..page
- ..head03RSCROLLLEFT
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Scroll the window to the left N columns
- filling in blank columns at the right of
- the window with the attribute passed.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V17.ENH
-
- Format : ScrollLeft(Cols,Attr,X1,Y1,X2,Y2);
-
- Remarks : Cols is an integer in the range 0
- to 25. If gives the number of
- columns the window is to be
- scrolled left.
-
- Attr is an integer in the range 0
- to 255. It gives the
- attribute to be used when
- filling in the blank lines at
- the top of the window.
-
- X1 is an integer in the range 1
- to 40 or 1 to 80, depending
- upon the screen width. It
- gives the left column of the
- window on the screen.
-
- Y1 is an integer in the range 1
- to 25. It gives the top row
- of the window on the screen.
-
- X2 is an integer in the range 1
- to 40 or 1 to 80, depending
- upon the screen width. It
- gives the right column of the
- window on the screen.
- ..page
- ..head05L
- Y2 is an integer in the range 1
- to 25. It gives the bottom
- row of the window on the
- screen.
-
-
- Example : ScrollLeft(1,48,4,5,15,20);
-
- In this example one column will be scrolled
- left in the window with the right column
- (col 15) being filled in with cyan
- on a Color/Graphics Adapter.
-
- ScrollLeft(0,7,4,5,15,20);
-
- In this example the entire window will be
- cleared.
- ..page
- ..head03RSCROLLUP
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Scroll the window up N lines filling in
- blank lines at the bottom of the window
- with the attribute passed.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V18.ENH
-
- Format : ScrollUp(Lines,Attr,X1,Y1,X2,Y2);
-
- Remarks : Lines is an integer in the range 0
- to 25. If gives the number of
- lines the window is to be
- scrolled.
-
- Attr is an integer in the range 0
- to 255. It gives the
- attribute to be used when
- filling in the blank lines at
- the top of the window.
-
- X1 is an integer in the range 1
- to 40 or 1 to 80, depending
- upon the screen width. It
- gives the left column of the
- window on the screen.
-
- Y1 is an integer in the range 1
- to 25. It gives the top row
- of the window on the screen.
-
- X2 is an integer in the range 1
- to 40 or 1 to 80, depending
- upon the screen width. It
- gives the right column of the
- window on the screen.
- ..page
- ..head05L
- Y2 is an integer in the range 1
- to 25. It gives the bottom
- row of the window on the
- screen.
-
-
- Example : ScrollUp(1,48,4,5,15,20);
-
- In this example one line will be scrolled
- up in the window with the bottom line (row
- 20) being filled in with cyan on a
- Color/Graphics Adapter.
-
- ScrollUp(0,7,4,5,15,20);
-
- In this example the entire window will be
- cleared.
- ..page
- ..head03RSCROLLRIGHT
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Scroll the window right N columns filling
- in blank columns at the left of the window
- with the attribute passed.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V19.ENH
-
- Format : ScrollRight(Cols,Attr,X1,Y1,X2,Y2);
-
- Remarks : Lines is an integer in the range 0
- to 25. If gives the number of
- lines the window is to be
- scrolled.
-
- Attr is an integer in the range 0
- to 255. It gives the
- attribute to be used when
- filling in the blank lines at
- the top of the window.
-
- X1 is an integer in the range 1
- to 40 or 1 to 80, depending
- upon the screen width. It
- gives the left column of the
- window on the screen.
-
- Y1 is an integer in the range 1
- to 25. It gives the top row
- of the window on the screen.
-
- X2 is an integer in the range 1
- to 40 or 1 to 80, depending
- upon the screen width. It
- gives the right column of the
- window on the screen.
- ..page
- ..head05L
- Y2 is an integer in the range 1
- to 25. It gives the bottom
- row of the window on the
- screen.
-
-
- Example : ScrollRight(1,48,4,5,15,20);
-
- In this example one column will be scrolled
- to the right in the window with the left
- column (col 4) being filled in with cyan
- on a Color/Graphics Adapter.
-
- ScrollRight(0,7,4,5,15,20);
-
- In this example the entire window will be
- cleared.
- ..page
- ..head03RSETCURSORSIZE
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Set the size of the cursor.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V20.ENH
-
- Format : SetCursorSize(StartLine,EndLine);
-
- Remarks : StartLine is an integer giving the
- starting scan line to be used
- for the cursor.
-
- EndLine is an integer giving the
- ending scan line to be used
- for the cursor.
-
- StartLine and EndLine must be of Data Type
- Byte or Integer.
-
- The scan lines are numbered from 0 at the
- top (StartLine) to N at the bottom
- (EndLine) where N applies to the following
- video adapters.
-
- 7 - Color/Graphics Adapter
- 14 - Monochrome Adapter
-
- Example : The following examples are for the
- Color/Graphics Adapter:
-
- SetCursorSize(32,32);
-
- Makes the cursor invisible on the screen.
-
- SetCursorSize(0,7);
-
- Enlarges the cursor, covering the entire
- character cell.
- ..page
- ..head03RWAITMSG
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Display a message on the screen and waits
- until one of the specified keys is pressed
- to continue.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V21.ENH
-
- Format : WaitMsg(X,Y,Msg,TCSet,TE);
-
- Remarks : X is an integer in the range 1
- to 40 or 1 to 80, depending
- upon the screen width. It
- gives the absolute column
- on the screen.
-
- Y is an integer in the range 1
- to 25. It gives the absolute
- row on the screen.
-
- Msg is any string expression. It
- gives the message that is to
- be displayed on the screen.
-
- TCSet is the set of key combination
- elements that are allowed to
- terminate this procedure.
- (Refer to appendix C)
-
- TE is an integer that will return
- a value in the range 0-255. It
- corresponds to the terminating
- element number given in
- appendix C.
- ..page
- ..head05L
- Example : WaitMsg(1,25,'Printer error',[1,13],TE);
-
- This example will print the message
- 'Printer error' starting in column one on
- row 25. After the message is displayed the
- procedure will wait until either the ESC or
- ENTER key is pressed before conti- nuing.
-
- Global type definition for TCSet is:
-
- TCSet = Set of 0..255;
- ..page
- ..head03RWHEREXABS
- ..head04RFunction
- ..head05L_______________________________________________________
- Purpose : Returns the absolute column of the cursor
- on the physical window.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V22.ENH
-
- Format : WhereXAbs;
-
- Remarks : This function will return an integer in the
- range of 1 to 80 for 80 column text modes,
- and 1 to 40 for 40 column text modes.
-
- Example : i := WhereXAbs;
-
- The variable i will receive the absolute
- column of the cursor regardless of Turbo
- Pascal's currently defined window.
- ..page
- ..head03RWHEREYABS
- ..head04RFunction
- ..head05L_______________________________________________________
- Purpose : Returns the absolute row of the cursor on
- the physical window.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V23.ENH
-
- Format : WhereYAbs;
-
- Remarks : This function will return an integer in the
- range of 1 to 25.
-
- Example : i := WhereYAbs;
-
- The variable i will receive the absolute
- row of the cursor regardless of Turbo
- Pascal's currently defined window
- ..page
- ..head03RWRITEST
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Display a string to the screen
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V24.ENH
-
- Format : WriteSt(St);
-
- Remarks : St is any string expression.
-
- WriteSt positions the cursor after the
- newly displayed string.
-
- WriteSt is NOT sensitive to Turbo's
- currently defined window and will wrap
- around to the next row of column one of the
- physical screen when necessary.
-
- WriteSt will not scroll the screen if the
- data to be displayed is to extend beyond
- the last row of the screen.
-
- Special Note : WriteSt requires a global type
- definition of:
-
- Str255 = String[255];
- ..page
- ..head03RWRITESTLN
- ..head04RProcedure
- ..head05L_______________________________________________________
- Purpose : Display a string to the screen.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Filename : V25.ENH
-
- Format : WriteStln(St);
-
-
- Remarks : St is any string expression.
-
- The cursor is positioned in column one on
- the next line of the physical screen after
- the data has been displayed.
-
- WriteStln is NOT sensitive to Turbo's
- currently defined window and will wrap
- around to the next row in column one when
- necessary.
-
- WriteSt will not scroll the screen if the
- data to be displayed is to extend beyond
- the last row of the screen.
-
- Special Note : WriteStln requires a global type
- definition of:
-
- Str255 = String[255];
- ..page
- ..pgno01
- ..head03RCLRKBD
- ..head04RProcedure
- ..head05L______________________________________________________
- ..foot48R3-##
- Purpose : Clears the keyboard buffer.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Format : ClrKbd;
-
-
- Remarks : This procedure will delete any characters
- in the keyboard buffer waiting to be read.
-
- Example : ClrKbd;
- ReadKbd(Ch);
- .
- .
- .
-
- In this example the keyboard buffer is
- flushed before reading a keystroke from the
- keyboard.
- ..page
- ..head03RGETKBDELMT
- ..head04RProcedure
- ..head05L______________________________________________________
- Purpose : Return an integer value for the key pressed
- on the keyboard.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Format : GetKbdElmt(i);
-
- Remarks : GetKbdElmt will return an integer in the
- range of 0 to 388. Use Appendix C to find
- the appropriate keyboard return codes of
- this procedure.
-
- Example : GetKbdElmt(i);
-
- If the key combination control-break was
- pressed, then on return from the procedure
- call GetKbdElmt i would contain the value
- of zero.
-
- If the 'A' was pressed then i would have
- returned the value 197.
-
- Note : Generally all of the key combinations using
- the control key with an alphabetic
- character and all other ascii characters
- will be offset by 132.
-
- If you study Appendix C you might be able
- to understand why things were done this
- way.
-
- ..page
- ..head03RKBDSTATUS
- ..head04RFunction
- ..head05L______________________________________________________
- Purpose : Return the keyboard status byte
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Format : n := KbdStatus;
-
-
- Remarks : KbdStatus returns the keyboard status byte
- as follows:
-
- BITS
-
- ---------------------------------
- | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
- ---------------------------------
-
- Bit Bit Value Key Pressed
- --- --------- -----------
- 0 - 1 - Right Shift
- 1 - 2 Left Shift
- 2 - 4 Control
- 3 - 8 Alternate
-
- Key Mode
- -----------
- 4 - 16 Scroll Lock
- 5 - 32 Num Lock
- 6 - 64 Caps Lock
- 7 - 128 Insert
-
- A one in the bit position means the
- condition is true and a zero in the bit
- position means the condition is false.
-
- Example : If (KbdStatus And 6) <> 0 Then . . .
-
- The above example checks to see if either
- of the CONTROL or the LEFT SHIFT keys are
- pressed.
- ..page
- ..head03RREADKBD
- ..head04RProcedure
- ..head05L______________________________________________________
- Purpose : Read a character from the keyboard.
-
- Versions : 2.00 3.00 3.01B
- ** ** **
-
- Format : ReadKbd(Ch);
-
-
- Remarks : ReadKbd reads a single character from the
- keyboard buffer. ReadKbd will return a
- zero, one, or two character string.
-
- A null string indicates that Ctrl-Break was
- pressed.
-
- A one-character string indicates a normal
- ascii character was read from the keyboard.
-
- A two-character string indicates a special
- extended keyboard code. Refer to appendix
- B for a list of the extended keyboard
- codes.
-
- The data type definition for ReadKbd is an
- untyped variable using a minimun of three
- bytes.
-
- Example : Type
- Str2 = String[2];
- Var
- Ch : Str2;
- Begin
- ReadKbd(Ch);
- Case Ch[1] Of
- #00 : Writeln('Ctrl char pressed');
- #27 : Writeln('Other key comb used');
- #32..#127 : Writeln('Ascii pressed');
- End;
- End.
- ..page
- ..head05
- In this example any key or key combination
- that is read from the keyboard will be
- grouped into one of three categories.
-
- If Ch[1] is equal to the null byte then the
- chances are that one of the control
- characters (0-31) was pressed. This
- includes the enter key, backspace, tab, and
- key combinations that use the control and
- an ACSII character A-Z.
-
- If Ch[1] is equal to #27 then the chances
- are that some other key combination was
- used, generally involving the alt key or
- control key with one of the function keys
- or cursor movement keys.
-
- If Ch[1] is in the range #32..#127 then an
- ASCII character was pressed. The length
- will also be one, where as in the other two
- possibilites the length will be two.
- ..page
- ..pgno01
- ..head03R
- ..head04CSUMMARY OF PROCEDURES AND FUNCTIONS
- ..head05L_______________________________________________________
- ..foot48RA-##
- VIDEO PROCEDURES AND FUNCTIONS
-
- PROCEDURES
-
- BoarderColor(Color : Integer);
- ClrWin;
- ColorMsg(Y,X,Color : Integer; Message : Str255);
- EditSt(X,StartY,StopX,Len,CM : Integer;
- VCSet,TCSet : TSet;
- Var TE : Integer;
- Var St );
- FillCol(Y,X,Num : Integer; Ch : Char);
- FillColAttr(Y,X,Num,Color : Integer);
- FillRow(Y,X,Num : Integer; Ch : Char);
- FillRowAttr(Y,X,Num,Color : Integer);
- FrameWin(UL,UR,LL,LR,Hor,Ver : Char);
- GetScrn(Y,X,NumChars : Integer; Var ChArray);
- GetScrnAttr(Y,X,NumBytes : Integer; Var ChArray);
- GotoXYAbs(Y,X : Integer);
- InitVideo(Mode : Integer);
- PutScrn(Y,X,NumChars : Integer; Var ChArray);
- RvsVideo;
- ScrollDn(Lines,Color,Y1,X1,Y2,X2 : Integer);
- ScrollLeft(Columns,Color,Y1,X1,Y2,X2 : Integer);
- ScrollUp(Lines,Color,Y1,X1,Y2,X2 : Integer);
- ScrollRight(Columns,Color,Y1,X1,Y2,X2 : Integer);
- SetCursorSize(StartLine,EndLine : Integer);
- WaitMsg(Y,X : Integer; St : Str255;
- Var TE : Integer);
- WriteSt(St : Str255);
- WriteStLn(St : Str255);
-
- FUNCTIONS
-
- GetCursorSize : Integer;
- GetVideoMode : Integer;
- WhereXAbs : Integer;
- WhereYAbs : Integer;
- ..page
- ..head05
- KEYBOARD PROCEDURES AND FUNCTIONS
-
- PROCEDURES
-
- ClrKbd;
- GetKbdElmt(Var ElmtNum : Integer);
- ReadKbd(Var Ch);
-
- FUNCTIONS
-
- KbdStatus : Integer;
- ..page
- ..pgno01
- ..head03R
- ..head04CKEYBOARD RETURN CODES
- ..head05L_______________________________________________________
- ..foot48RB-##
- This appendix lists the keyboard codes for all the key
- combinations for the entire keyboard, as they are seen
- by the procedure READKBD. All keys are turned into
- either a one or two character code.
-
- To understand the table below assume St is a two
- character string. St[0] is the length of the character
- code returned. If the length of St is one then a
- normal ASCII character was pressed, otherwise an
- extended code is generated. Notice that some of the
- keyboard codes do produce a two character code with the
- first character being null.
-
- If the length of St is one then a normal ASCII
- character code was read from the keyboard. This
- basically covers the ASCII values 32-127.
-
- If the length of St is two then one of the keys, that
- are usually used for cursor control, was read from the
- keyboard. If this is the case then St[1] will be
- either a 0 or 27 depending on the key combination read
- from the keyboard.
-
- Use of the case statement works well with this type of
- setup to determine which keyboard keys were read from
- the keyboard.
-
- Case Ch[1] Of
- #00 : Writeln('Control code used.');
- #27 : Writeln('Control code used.');
- #32..#127 : Writeln('Printable code used.');
- End;
- ..page
- ..head03R
- ..head04R
- ..head05L
- Key Key
- Pressed CH[0] CH[1] CH[2] Pressed CH[0] CH[1] CH[2]
- --------- ----- ----- ----- --------- ----- ----- -----
- (space) 1 32 0 E 1 69 0
- ! 1 33 0 F 1 70 0
- " 1 34 0 G 1 71 0
- # 1 35 0 H 1 72 0
- $ 1 36 0 I 1 73 0
- % 1 37 0 J 1 74 0
- & 1 38 0 K 1 75 0
- ' 1 39 0 L 1 76 0
- ( 1 40 0 M 1 77 0
- ) 1 41 0 N 1 78 0
- * 1 42 0 O 1 79 0
- + 1 43 0 P 1 80 0
- , 1 44 0 Q 1 81 0
- - 1 45 0 R 1 82 0
- . 1 46 0 S 1 83 0
- / 1 47 0 T 1 84 0
- 0 1 48 0 U 1 85 0
- 1 1 49 0 V 1 86 0
- 2 1 50 0 W 1 87 0
- 3 1 51 0 X 1 88 0
- 4 1 52 0 Y 1 89 0
- 5 1 53 0 Z 1 90 0
- 6 1 54 0 [ 1 91 0
- 7 1 55 0 \ 1 92 0
- 8 1 56 0 ] 1 93 0
- 9 1 57 0 ^ 1 94 0
- : 1 58 0 _ 1 95 0
- ; 1 59 0 ` 1 96 0
- < 1 60 0 a 1 97 0
- = 1 61 0 b 1 98 0
- > 1 62 0 c 1 99 0
- ? 1 63 0 d 1 100 0
- @ 1 64 0 e 1 101 0
- A 1 65 0 f 1 102 0
- B 1 66 0 g 1 103 0
- C 1 67 0 h 1 104 0
- D 1 68 0 i 1 105 0
- ..page
- Key Key
- Pressed Ch[0] Ch[1] Ch[2] Pressed Ch[0] Ch[1] Ch[2]
- --------- ----- ----- ----- --------- ----- ----- -----
- j 1 106 0 Alt-I 2 27 23
- k 1 107 0 Alt-O 2 27 24
- l 1 108 0 Alt-P 2 27 25
- m 1 109 0 Alt-A 2 27 30
- n 1 110 0 Alt-S 2 27 31
- o 1 111 0 Alt-D 2 27 32
- p 1 112 0 Alt-F 2 27 33
- q 1 113 0 Alt-G 2 27 34
- r 1 114 0 Alt-H 2 27 35
- s 1 115 0 Alt-J 2 27 36
- t 1 116 0 Alt-K 2 27 37
- u 1 117 0 Alt-L 2 27 38
- v 1 118 0 Alt-Z 2 27 44
- w 1 119 0 Alt-X 2 27 45
- x 1 120 0 Alt-C 2 27 46
- y 1 121 0 Alt-V 2 27 47
- z 1 122 0 Alt-B 2 27 48
- { 1 123 0 Alt-N 2 27 49
- | 1 124 0 Alt-M 2 27 50
- } 1 125 0 F1 2 27 59
- ~ 1 126 0 F2 2 27 60
- Ctrl-Break 2 27 0 F3 2 27 61
- Esc 2 27 1 F4 2 27 62
- Ctrl-2 2 27 3 F5 2 27 63
- BackSp 2 27 8 F6 2 27 64
- Tab 2 27 9 F7 2 27 65
- Ctrl-Enter 2 27 10 F8 2 27 66
- Enter 2 27 13 F9 2 27 67
- Ctrl-BS 2 27 14 F10 2 27 68
- Shft-Tab 2 27 15 Home 2 27 71
- Alt-Q 2 27 16 UArr 2 27 72
- Alt-W 2 27 17 PgUp 2 27 73
- Alt-E 2 27 18 LArr 2 27 75
- Alt-R 2 27 19 RArr 2 27 77
- Alt-T 2 27 20 End 2 27 79
- Alt-Y 2 27 21 DArr 2 27 80
- Alt-U 2 27 22 PgDn 2 27 81
- ..page
- Key Key
- Pressed Ch[0] Ch[1] Ch[2] Pressed Ch[0] Ch[1] Ch[2]
- --------- ----- ----- ----- --------- ----- ----- -----
- Ins 2 27 82 Alt-1 2 27 120
- Del 2 27 83 Alt-2 2 27 121
- Shft-F1 2 27 84 Alt-3 2 27 122
- Shft-F2 2 27 85 Alt-4 2 27 123
- Shft-F3 2 27 86 Alt-5 2 27 124
- Shft-F4 2 27 87 Alt-6 2 27 125
- Shft-F5 2 27 88 Alt-7 2 27 126
- Shft-F6 2 27 89 Alt-8 2 27 127
- Shft-F7 2 27 90 Alt-9 2 27 128
- Shft-F8 2 27 91 Alt-0 2 27 129
- Shft-F9 2 27 92 Alt-- 2 27 130
- Shft-F10 2 27 93 Alt-= 2 27 131
- Ctrl-F1 2 27 94 Ctrl-PgUp 2 27 132
- Ctrl-F2 2 27 95 Ctrl-A 2 0 1
- Ctrl-F3 2 27 96 Ctrl-B 2 0 2
- Ctrl-F4 2 27 97 Ctrl-C 2 0 3
- Ctrl-F5 2 27 98 Ctrl-D 2 0 4
- Ctrl-F6 2 27 99 Ctrl-E 2 0 5
- Ctrl-F7 2 27 100 Ctrl-F 2 0 6
- Ctrl-F8 2 27 101 Ctrl-G 2 0 7
- Ctrl-F9 2 27 102 Ctrl-H 2 0 8
- Ctrl-F10 2 27 103 Ctrl-I 2 0 9
- Alt-F1 2 27 104 Ctrl-J 2 0 10
- Alt-F2 2 27 105 Ctrl-K 2 0 11
- Alt-F3 2 27 106 Ctrl-L 2 0 12
- Alt-F4 2 27 107 Ctrl-M 2 0 13
- Alt-F5 2 27 108 Ctrl-N 2 0 14
- Alt-F6 2 27 109 Ctrl-O 2 0 15
- Alt-F7 2 27 110 Ctrl-P 2 0 16
- Alt-F8 2 27 111 Ctrl-Q 2 0 17
- Alt-F9 2 27 112 Ctrl-R 2 0 18
- Alt-F10 2 27 113 Ctrl-S 2 0 19
- Ctrl-LArr 2 27 115 Ctrl-T 2 0 20
- Ctrl-RArr 2 27 116 Ctrl-U 2 0 21
- Ctrl-End 2 27 117 Ctrl-V 2 0 22
- Ctrl-PgDn 2 27 118 Ctrl-W 2 0 23
- Ctrl-Home 2 27 119 Ctrl-X 2 0 24
- ..page
- Key
- Pressed Ch[0] Ch[1] Ch[2]
- --------- ----- ----- -----
- Ctrl-Y 2 0 25
- Ctrl-Z 2 0 26
- Ctrl-[ 2 0 27
- Ctrl-\ 2 0 28
- Ctrl-] 2 0 29
- Ctrl-6 2 0 30
- Ctrl-- 2 0 31
- ..page
- ..pgno01
- ..head03R
- ..head04CKEYBOARD ELEMENT CODES
- ..head05L_______________________________________________________
- ..foot48RC-##
- This appendix lists the element codes for all the key
- combinations for the entire keyboard, as they are seen
- by the procedures WAITMSG and EDITST. All keys are
- turned into an integer element code.
-
- The Global type definition required for this table is:
-
- TSet = Set of 0..255;
-
- The unit or element number in the set defines which key
- or key combination was pressed. This table was created
- for use as the Terminating Character Set with the
- procedures WAITMSG and EDITST.
-
- For example if you were to use the procedure WAITMSG
- and you wanted either the Esc or Enter keys to termi-
- nate the procedure the following call to WAITMSG could
- be used:
-
- WaitMsg(1,1,'Message here',[1,13],TC);
-
- ** The element number for the ESC key is 1.
- ** The element number for the ENTER key is 13.
-
- ** Use the value in the column ELEMENT NUMBER to
- ** determine the element number of the terminating
- ** keys.
-
- This procedure would then display the message and would
- wait until either the ESC or ENTER key was pressed
- before continuing.
- ..page
- ..head03R
- ..head04R
- ..head05L
- Element Element
- Key code AH AL Number Key code AH AL Number
- --------- --- --- ------- --------- --- --- -------
- Ctrl-Break 0 0 0 Alt-K 37 0 37
- Esc 1 27 1 Alt-L 38 0 38
- 2 39
- Ctrl-2 3 0 3 40
- 4 41
- 5 42
- 6 43
- 7 Alt-Z 44 0 44
- BackSp 14 8 8 Alt-X 45 0 45
- Tab 15 9 9 Alt-C 46 0 46
- Ctrl-Enter 28 10 10 Alt-V 47 0 47
- 11 Alt-B 48 0 48
- 12 Alt-N 49 0 49
- Enter 28 13 13 Alt-M 50 0 50
- Ctrl-BS 14 127 14 51
- Shft-Tab 15 0 15 52
- Alt-Q 16 0 16 53
- Alt-W 17 0 17 54
- Alt-E 18 0 18 55
- Alt-R 19 0 19 56
- Alt-T 20 0 20 57
- Alt-Y 21 0 21 58
- Alt-U 22 0 22 F1 59 0 59
- Alt-I 23 0 23 F2 60 0 60
- Alt-O 24 0 24 F3 61 0 61
- Alt-P 25 0 25 F4 62 0 62
- 26 F5 63 0 63
- 27 F6 64 0 64
- 28 F7 65 0 65
- 29 F8 66 0 66
- Alt-A 30 0 30 F9 67 0 67
- Alt-S 31 0 31 F10 68 0 68
- Alt-D 32 0 32 69
- Alt-F 33 0 33 70
- Alt-G 34 0 34 Home 71 0 71
- Alt-H 35 0 35 UArr 72 0 72
- Alt-J 36 0 36 PgUp 73 0 73
- ..page
- Element Element
- Key code AH AL Number Key code AH AL Number
- --------- --- --- ------- --------- --- --- -------
- 74 Alt-F8 111 0 111
- LArr 75 0 75 Alt-F9 112 0 112
- 76 Alt-F10 113 0 113
- RArr 77 0 77 114
- 78 Ctrl-LArr 115 0 115
- End 79 0 79 Ctrl-RArr 116 0 116
- DArr 80 0 80 Ctrl-End 117 0 117
- PgDn 81 0 81 Ctrl-PgDn 118 0 118
- Ins 82 0 82 Ctrl-Home 119 0 119
- Del 83 0 83 Alt-1 120 0 120
- Shft-F1 84 0 84 Alt-2 121 0 121
- Shft-F2 85 0 85 Alt-3 122 0 122
- Shft-F3 86 0 86 Alt-4 123 0 123
- Shft-F4 87 0 87 Alt-5 124 0 124
- Shft-F5 88 0 88 Alt-6 125 0 125
- Shft-F6 89 0 89 Alt-7 126 0 126
- Shft-F7 90 0 90 Alt-8 127 0 127
- Shft-F8 91 0 91 Alt-9 128 0 128
- Shft-F9 92 0 92 Alt-0 129 0 129
- Shft-F10 93 0 93 Alt-- 130 0 130
- Ctrl-F1 94 0 94 Alt-= 131 0 131
- Ctrl-F2 95 0 95 Ctrl-PgUp 132 0 132
- Ctrl-F3 96 0 96
- Ctrl-F4 97 0 97
- Ctrl-F5 98 0 98
- Ctrl-F6 99 0 99
- Ctrl-F7 100 0 100
- Ctrl-F8 101 0 101
- Ctrl-F9 102 0 102
- Ctrl-F10 103 0 103
- Alt-F1 104 0 104
- Alt-F2 105 0 105
- Alt-F3 106 0 106
- Alt-F4 107 0 107
- Alt-F5 108 0 108
- Alt-F6 109 0 109
- Alt-F7 110 0 110
- ..page
- AL+ Element AL+ Element
- Key code 132 AL Number Key code 132 AL Number
- --------- --- --- ------- --------- --- --- -------
- Ctrl-A 133 1 133 & 170 38 170
- Ctrl-B 134 2 134 ' 171 39 171
- Ctrl-C 135 3 135 ( 172 40 172
- Ctrl-D 136 4 136 ) 173 41 173
- Ctrl-E 137 5 137 * 174 42 174
- Ctrl-F 138 6 138 + 175 43 175
- Ctrl-G 139 7 139 , 176 44 176
- Ctrl-H 140 8 140 - 177 45 177
- Ctrl-I 141 9 141 . 178 46 178
- Ctrl-J 142 10 142 / 179 47 179
- Ctrl-K 143 11 143 0 180 48 180
- Ctrl-L 144 12 144 1 181 49 181
- Ctrl-M 145 13 145 2 182 50 182
- Ctrl-N 146 14 146 3 183 51 183
- Ctrl-O 147 15 147 4 184 52 184
- Ctrl-P 148 16 148 5 185 53 185
- Ctrl-Q 149 17 149 6 186 54 186
- Ctrl-R 150 18 150 7 187 55 187
- Ctrl-S 151 19 151 8 188 56 188
- Ctrl-T 152 20 152 9 189 57 189
- Ctrl-U 153 21 153 : 190 58 190
- Ctrl-V 154 22 154 ; 191 59 191
- Ctrl-W 155 23 155 < 192 60 192
- Ctrl-X 156 24 156 = 193 61 193
- Ctrl-Y 157 25 157 > 194 62 194
- Ctrl-Z 158 26 158 ? 195 63 195
- Ctrl-[ 159 27 159 @ 196 64 196
- Ctrl-\ 160 28 160 A 197 65 197
- Ctrl-] 161 29 161 B 198 66 198
- Ctrl-6 162 30 162 C 199 67 199
- Ctrl-- 163 31 163 D 200 68 200
- (space) 164 32 164 E 201 69 201
- ! 165 33 165 F 202 70 202
- " 166 34 166 G 203 71 203
- # 167 35 167 H 204 72 204
- $ 168 36 168 I 205 73 205
- % 169 37 169 J 206 74 206
- ..page
- AL+ Element AL+ Element
- Key code 132 AL Number Key code 132 AL Number
- --------- --- --- ------- --------- --- --- -------
- K 207 75 207 p 244 112 244
- L 208 76 208 q 245 113 245
- M 209 77 209 r 246 114 246
- N 210 78 210 s 247 115 247
- O 211 79 211 t 248 116 248
- P 212 80 212 u 249 117 249
- Q 213 81 213 v 250 118 250
- R 214 82 214 w 251 119 251
- S 215 83 215 x 252 120 252
- T 216 84 216 y 253 121 253
- U 217 85 217 z 254 122 254
- V 218 86 218 { 255 123 255
- W 219 87 219
- X 220 88 220
- Y 221 89 221
- Z 222 90 222
- [ 223 91 223
- \ 224 92 224
- ] 225 93 225
- ^ 226 94 226
- _ 227 95 227
- ` 228 96 228
- a 229 97 229
- b 230 98 230
- c 231 99 231
- d 232 100 232
- e 233 101 233
- f 234 102 234
- g 235 103 235
- h 236 104 236
- i 237 105 237
- j 238 106 238
- k 239 107 239
- l 240 108 240
- m 241 109 241
- n 242 110 242
- o 243 111 243
- ..page
- ..pgno01
- ..head03R
- ..head04CKEYBOARD CODES
- ..head05L_______________________________________________________
- ..foot48RD-##
- This appendix lists the keyboard codes that are
- returned by the computer system when a key or key
- combination is pressed.
-
- The column headings AH and AL refer to the hi and lo
- registers within the AX register.
-
- These are the actual values returned by the BIOS inter-
- rupt 16H in assemlby language.
- ..page
- ..head03R
- ..head04R
- ..head05L
- Key Key
- Pressed AH AL Pressed AH AL
- --------- ----- ----- --------- ----- -----
- (space) 57 32 E 18 69
- ! 2 33 F 33 70
- " 40 34 G 34 71
- # 4 35 H 35 72
- $ 5 36 I 23 73
- % 6 37 J 36 74
- & 8 38 K 37 75
- ' 40 39 L 38 76
- ( 10 40 M 50 77
- ) 11 41 N 49 78
- * 9 42 O 24 79
- + 13 43 P 25 80
- , 51 44 Q 16 81
- - 12 45 R 19 82
- . 52 46 S 31 83
- / 53 47 T 20 84
- 0 11 48 U 22 85
- 1 2 49 V 47 86
- 2 3 50 W 17 87
- 3 4 51 X 48 88
- 4 5 52 Y 21 89
- 5 6 53 Z 44 90
- 6 7 54 [ 26 91
- 7 8 55 \ 43 92
- 8 9 56 ] 27 93
- 9 10 57 ^ 7 94
- : 39 58 _ 12 95
- ; 39 59 ` 41 96
- < 51 60 a 30 97
- = 13 61 b 48 98
- > 52 62 c 46 99
- ? 53 63 d 32 100
- @ 3 64 e 18 101
- A 30 65 f 33 102
- B 48 66 g 34 103
- C 46 67 h 35 104
- D 32 68 i 23 105
- ..page
- Key Key
- Pressed AH AL Pressed AH AL
- --------- ----- ----- --------- ----- -----
- j 36 106 Esc 1 27
- k 37 107 Alt-A 30 0
- l 38 108 Alt-S 31 0
- m 50 109 Alt-D 32 0
- n 49 110 Alt-F 33 0
- o 24 111 Alt-G 34 0
- p 25 112 Alt-H 35 0
- q 16 113 Alt-J 36 0
- r 19 114 Alt-K 37 0
- s 31 115 Alt-L 38 0
- t 20 116 Alt-Z 44 0
- u 22 117 Alt-X 45 0
- v 47 118 Alt-C 46 0
- w 17 119 Alt-V 47 0
- x 48 120 Alt-B 48 0
- y 21 121 Alt-N 49 0
- z 44 122 Alt-M 50 0
- { 26 123 F1 59 0
- | 43 124 F2 60 0
- } 27 125 F3 61 0
- ~ 41 126 F4 62 0
- Ctrl-2 3 0 F5 63 0
- BackSp 14 8 F6 64 0
- Tab 15 9 F7 65 0
- Ctrl-Enter 28 10 F8 66 0
- Enter 28 13 F9 67 0
- Shft-Tab 15 0 F10 68 0
- Alt-Q 16 0 Home 71 0
- Alt-W 17 0 UArr 72 0
- Alt-E 18 0 PgUp 73 0
- Alt-R 19 0 LArr 75 0
- Alt-T 20 0 RArr 77 0
- Alt-Y 21 0 End 79 0
- Alt-U 22 0 DArr 80 0
- Alt-I 23 0 PgDn 81 0
- Alt-O 24 0 Ins 82 0
- Alt-P 25 0 Del 83 0
- ..page
- Key Key
- Pressed AH AL Pressed AH AL
- --------- ----- ----- --------- ----- -----
- Shft-F1 84 0 Alt-3 122 0
- Shft-F2 85 0 Alt-4 123 0
- Shft-F3 86 0 Alt-5 124 0
- Shft-F4 87 0 Alt-6 125 0
- Shft-F5 88 0 Alt-7 126 0
- Shft-F6 89 0 Alt-8 127 0
- Shft-F7 90 0 Alt-9 128 0
- Shft-F8 91 0 Alt-0 129 0
- Shft-F9 92 0 Alt-- 130 0
- Shft-F10 93 0 Alt-= 131 0
- Ctrl-F1 94 0 Ctrl-PgUp 132 0
- Ctrl-F2 95 0 Ctrl-A 30 1
- Ctrl-F3 96 0 Ctrl-B 48 2
- Ctrl-F4 97 0 Ctrl-C 46 3
- Ctrl-F5 98 0 Ctrl-D 32 4
- Ctrl-F6 99 0 Ctrl-E 18 5
- Ctrl-F7 100 0 Ctrl-F 33 6
- Ctrl-F8 101 0 Ctrl-G 34 7
- Ctrl-F9 102 0 Ctrl-H 35 8
- Ctrl-F10 103 0 Ctrl-I 23 9
- Alt-F1 104 0 Ctrl-J 36 10
- Alt-F2 105 0 Ctrl-K 37 11
- Alt-F3 106 0 Ctrl-L 38 12
- Alt-F4 107 0 Ctrl-M 50 13
- Alt-F5 108 0 Ctrl-N 49 14
- Alt-F6 109 0 Ctrl-O 24 15
- Alt-F7 110 0 Ctrl-P 25 16
- Alt-F8 111 0 Ctrl-Q 16 17
- Alt-F9 112 0 Ctrl-R 19 18
- Alt-F10 113 0 Ctrl-S 31 19
- Ctrl-LArr 115 0 Ctrl-T 20 20
- Ctrl-RArr 116 0 Ctrl-U 22 21
- Ctrl-End 117 0 Ctrl-V 47 22
- Ctrl-PgDn 118 0 Ctrl-W 17 23
- Ctrl-Home 119 0 Ctrl-X 48 24
- Alt-1 120 0 Ctrl-Y 21 25
- Alt-2 121 0 Ctrl-Z 44 26
- ..page
- Key
- Pressed AH AL
- --------- ----- -----
- Ctrl-[ 26 27
- Ctrl-\ 43 28
- Ctrl-] 27 29
- Ctrl-6 7 30
- Ctrl-- 12 31
- Ctrl-BS 14 127
- Ctrl-Break 0 0
- ..page
- ..pgno01
- ..head03R
- ..head04CKEYBOARD SCAN CODES
- ..head05L_______________________________________________________
- ..foot48RE-##
- FUNCTION KEYS
-
- Scan | Scan | Scan | Scan |
- Key Code | Key Code | Key Code | Key Code |
- --- ---- | --- ---- | --- ---- | --- ---- |
- F1 59 | F4 62 | F7 65 | F10 68 |
- F2 60 | F5 63 | F8 66 | |
- F3 61 | F6 64 | F9 67 | |
-
-
- NUMERIC KEYPAD
-
- Scan | Scan | Scan | Scan |
- Key Code | Key Code | Key Code | Key Code |
- --- ---- | --- ---- | --- ---- | --- ---- |
- 7 71 | 4 76 | 1 79 | . 83 |
- 8 72 | 5 76 | 2 80 | |
- 9 73 | 6 77 | 3 81 | |
- - 74 | + 78 | 0 82 | |
-
-
- CONTROL KEYS
-
- Scan | Scan
- Key Code | Key Code
- --- ---- | --- ----
- Esc 1 | Ctrl 29
- Backspace 14 | Left Shft 42
- Num Lock 69 | Right Shft 54
- Scroll Lock 70 | Alt 56
- Tab 15 | Caps Lock 58
- Enter 28 |
- ..page
- ..head03R
- ..head04R
- ..head05L
- LETTER, NUMBER, AND PUNCTUATION KEYS
-
- Scan | Scan | Scan | Scan
- Key Code | Key Code | Key Code | Key Code
- --- ---- | --- ---- | --- ---- | --- ----
- 1 2 | W 17 | D 32 | C 46
- 2 3 | E 18 | F 33 | V 47
- 3 4 | R 19 | G 34 | B 48
- 4 5 | T 20 | H 35 | N 49
- 5 6 | Y 21 | J 36 | M 50
- 6 7 | U 22 | K 37 | , 51
- 7 8 | I 23 | L 38 | . 52
- 8 9 | O 24 | ; 39 | / 53
- 9 10 | P 25 | ' 40 | (PrtSc) 55
- 0 11 | [ 26 | ` 41 | (Space) 57
- - 12 | ] 27 | \ 43 |
- = 13 | A 30 | Z 44 |
- Q 16 | S 31 | X 45 |
- ..page